apiVersion: v1
kind: PersistentVolume
metadata:
  name: sg-ik-es-master-0
  labels:
    pv: sg-ik-es-master
spec:
  capacity:
    storage: 200Gi
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  local:
    path: {{ sg_ik_es_data }}/master-0
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - {{ groups['sgikes'][0] }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: sg-ik-es-master-1
  labels:
    pv: sg-ik-es-master
spec:
  capacity:
    storage: 200Gi 
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  local:
    path: {{ sg_ik_es_data }}/master-1
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - {{ groups['sgikes'][1] }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: sg-ik-es-master-2
  labels:
    pv: sg-ik-es-master
spec:
  capacity:
    storage: 200Gi 
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  local:
    path: {{ sg_ik_es_data }}/master-2
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - {{ groups['sgikes'][2] }}
